<!DOCTYPE HTML>
<html lang="en">
<head>
  <meta name="copyright" content=
  "Copyright (c) IBM Corporation and others 2011. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page.">
  <meta charset="utf-8">
  <link rel="STYLESHEET" href="../book.css" type="text/css">
  <title>Project Builder Ant Targets</title>
</head>
<body>
  <h1>Project Builder Ant Targets</h1>
  <p>When creating a new project builder using an Ant build file, one of the key pieces of information to set up and
  understand is the targets and when they will be executed.</p>
  <p>When you create a new Ant buildfile project builder, the default target is set to be run for <b>After a
  "Clean"</b> and <b>Manual Build</b> and the remaining two kinds; <b>Auto Build</b> and <b>During a "Clean"</b> are
  set to not be executed. If you want to configure your builder to execute specific targets from your buildfile for
  specific build kinds then more understanding of what the build kinds are, and more importantly, when they will be
  executed is required.</p>
  <p>The following sections describe each build kind and when it is executed.</p>
  <h3>After a "clean"</h3>
  <p>This build kind is executed <i>after</i> a project has been cleaned via the <b>Project &gt; Clean...</b>
  command.</p>
  <p><b>After a "Clean"</b> will execute during the next build immediately following the clean regardless of your
  workspace auto-build settings. If you have workspace auto-build <i>on</i> this will execute automatically following
  the clean, otherwise you will have to invoke one of the manual build commands; <b>Project &gt; Build Project</b>,
  <b>Project &gt; Build All</b> or enable <b>Project &gt; Build Automatically</b>.</p>
  <h3>Manual Build</h3>
  <p>This build kind is executed when you have workspace auto-build (<b>Project &gt; Build Automatically</b>) turned
  <i>off</i> and you invoke a build via the <b>Project &gt; Build Project</b> or <b>Project &gt; Build All</b>
  (<b>Ctrl+B</b>) command.</p>
  <p>There are three exceptions to when <b>Manual Build</b> targets execute:</p>
  <ol>
    <li>If the build is the first build following a clean (<b>Project &gt; Clean...</b>) then an <b>After a "Clean"</b>
    build will be executed instead</li>
    <li>If there are no targets set to run for <b>After a "Clean"</b>, then the <b>Manual Build</b> targets will be
    executed following a clean (<b>Project &gt; Clean...</b>)</li>
    <li>If there is nothing to be built, i.e. no changes have been made to the project, then <b>Manual Build</b>
    targets will <i>not</i> be executed</li>
  </ol>
  <h3>Auto Build</h3>
  <p>This build kind is executed when you have workspace auto-build (<b>Project &gt; Build Automatically</b>) turned
  <i>on</i> and you make changes in your project and save them.</p>
  <h3>During a "clean"</h3>
  <p>This build kind is executed when you invoke a clean build via the (<b>Project &gt; Clean...</b>) command.</p>
  <p><b>During a "Clean"</b> does not depend on the workspace auto-build setting (<b>Project &gt; Build
  Automatically</b>) as it executes during the clean build, not after, like <b>After a "Clean"</b> or <b>Manual
  Build</b>.</p>
  <h3 class="related">Related Tasks</h3><a href="qs-82_create.htm">Creating Ant buildfiles</a><br>
  <a href="qs-83_edit.htm">Editing Ant buildfiles</a><br>
  <a href="qs-85_ant_configs.htm">Saving &amp; Reusing Ant options</a><br>
  <a href="qs-84_run_ant.htm">Running Ant buildfiles</a><br>
  <a href="qs-92_project_builders.htm">Ant buildfiles as project builders</a><br>
  <a href="qs-94_run_pj.htm">Executing project builders</a><br>
  <a href="qs-95_external_tools.htm">External tools</a><br>
  <a href="qs-96_non_ant_pjs.htm">Non-Ant project builders</a><br>
  <a href="qs-97_standalone_ets.htm">Stand-alone external tools</a>
</body>
</html>
